<ui:composition template="/admin/templates/ui2.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:archer="http://java.sun.com/jsf/archer"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

	<ui:define name="content">



		<link rel="stylesheet" type="text/css" href="/include/css/jscover.css" />



		<script type="text/javascript">
			//<![CDATA[
			/*弹框JS内容*/
// 			jQuery(document).ready(
// 					function($) {
// 						打开窗口
// 						$("#form\\:import").on('click', function(event) {
// 							event.preventDefault();
// 							$('.cd-popup').addClass('is-visible');
// 							$(".dialog-addquxiao").hide()
// 						});
// 						$("#form\\:import1").on('click', function(event) {
// 							event.preventDefault();
// 							$('.cd-popup').addClass('is-visible');
// 							$(".dialog-addquxiao").hide()
// 						});
// 						关闭窗口
// 						$('.cd-popup')
// 								.on(
// 										'click',
// 										function(event) {
// 											if ($(event.target).is(
// 													'.cd-popup-close')
// 													|| $(event.target).is(
// 															'.cd-popup')) {
// 												event.preventDefault();
// 												$(this).removeClass(
// 														'is-visible');
// 											}
// 										});
// 						       ESC关闭
// 						$(document).keyup(function(event) {
// 							if (event.which == '27') {
// 								$('.cd-popup').removeClass('is-visible');
// 							}
// 						});

// 					});

// 			function test() {

// 				alert("hehe");
// 				event.preventDefault();
// 				$('.cd-popup').addClass('is-visible');
// 			}
			
			function upload() {
				var upload = $("#form\\:upload").val();
				alert(upload);
			}
			//]]>
		</script>
<!-- 		<div class="cd-popup"> -->
<!-- 			<div class="cd-popup-container"> -->
<!-- 				<div class="cd-buttons"> -->
<!-- 					<img src="/include/images/loading_1.gif" -->
<!-- 						/><br /> -->
<!-- 					<div style="position:absolute; left:30%;bottom:5%">上传记录较多，请耐心等待上传</div> -->
<!-- 				</div> -->
<!-- 			</div> -->
<!-- 		</div> -->

		<div class="entry">
			<p:toolbar styleClass="admin-nav-toolbar">
				<p:toolbarGroup>
					<h:outputLabel value="#{commonMsg.currentPositionLabel} 记录导入"></h:outputLabel>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:separator />
					<p:button outcome="/admin/checktime/EmployeesClockList" value="考勤信息"></p:button>
				</p:toolbarGroup>
			</p:toolbar>
			<p:spacer></p:spacer>
			<h:form id="form" enctype="multipart/form-data">
				<p:panel id="filters">

					<h:panelGrid columns="2" columnClasses="col1,col2" id="panel">

						<h:outputLabel value="导入日期："></h:outputLabel>
						<ui:fragment>
							<h:selectOneMenu value="#{fileUploadExcel.importYear}"
								required="true">
								<f:selectItem itemLabel="请选择年份" itemValue=""></f:selectItem>
								<f:selectItems var="year" value="#{empCheckUtil.getYears()}"
									itemLabel="#{year}" itemValue="#{year}"></f:selectItems>
							</h:selectOneMenu>
							<h:outputLabel value="年"></h:outputLabel>
							<h:selectOneMenu value="#{fileUploadExcel.importMonth}"
								required="true">
								<f:selectItem itemLabel="请选择月份" itemValue=""></f:selectItem>
								<f:selectItems var="year" value="#{empCheckUtil.getMonths()}"
									itemLabel="#{year}" itemValue="#{year}"></f:selectItems>
							</h:selectOneMenu>
							<h:outputLabel value="月"></h:outputLabel>
						</ui:fragment>
						<h:outputLabel value="导入文件："></h:outputLabel>
						<ui:fragment>
							<!-- <br/> -->
							<p:fileUpload value="#{fileUploadExcel.file}" mode="simple" onfocus="upload();"
								label="文件上传" sizeLimit="1000000" id="upload"
								allowTypes="/(\.|\/)(xls/xlsx)/">
							</p:fileUpload>
							
						
							
							
							<h:outputLabel value="*请上传Excel格式的文件，文件拓展名为.xls"
								style="color: red;"></h:outputLabel>
						</ui:fragment>
						<h:outputLabel value="操作："></h:outputLabel>

						<ui:fragment>
							<p:commandButton value="导入" ajax="false" id="import"
								action="#{fileUploadExcel.batchImport()}" type="submit"
								oncomplete="document.getElementById('form:upload').disabled=true;"></p:commandButton>
							<p:commandButton value="test" ajax="false" id="aa"
								action="#{fileUploadExcel.test()}" type="submit"
								></p:commandButton>
							<h:outputLabel value="*上传前请检查是否配置了当月休息日!!!" style="color: red;"></h:outputLabel>
							<p:button value="休息日配置" outcome="/admin/checktime/EmpHolidayList"></p:button>
						</ui:fragment>

					</h:panelGrid>
				</p:panel>
			</h:form>
		</div>
	</ui:define>
</ui:composition>

